<template>
  <div>
    <!--引用表格-->
   <BasicTable @register="registerTable" >
     <!--插槽:table标题-->
      <template #tableTitle>
          <a-button  type="primary" preIcon="ant-design:export-outlined" @click="onExportXls"> 导出</a-button>
      </template>
      <!--字段回显插槽-->
      <template v-slot:bodyCell="{ column, record, index, text }">
      </template>
    </BasicTable>
  </div>
</template>

<script lang="ts" name="dormitory-dormScoreStatic" setup>
  import {ref, reactive, computed, unref} from 'vue';
  import {BasicTable, useTable, TableAction} from '/@/components/Table';
  import {useModal} from '/@/components/Modal';
  import { useListPage } from '/@/hooks/system/useListPage'
  import {columns, searchFormSchema} from './DormScoreStatic.data';
  import {list,getExportUrl} from './DormScoreStatic.api';
  import { downloadFile } from '/@/utils/common/renderUtils';
  import { useUserStore } from '/@/store/modules/user';
  const queryParam = reactive<any>({});
  const checkedKeys = ref<Array<string | number>>([]);
  const userStore = useUserStore();
  //注册model
  const [registerModal, {openModal}] = useModal();
  //注册table数据
  const { prefixCls,tableContext,onExportXls,onImportXls } = useListPage({
      tableProps:{
           title: '内务打分统计',
           api: list,
           columns,
           canResize:false,
           formConfig: {
              //labelWidth: 120,
              schemas: searchFormSchema
            },
           actionColumn: {
               width: 60,
               fixed:'right'
            },
            showActionColumn:false,
            beforeFetch: (params) => {
              return Object.assign(params, queryParam);
            },
            pagination:false,
      },
       exportConfig: {
            name:"内务打分统计",
            url: getExportUrl,
            params: queryParam,
          },
  })

  const [registerTable, {reload},{ rowSelection, selectedRowKeys }] = tableContext
  
   /**
    * 成功回调
    */
  function handleSuccess() {
      (selectedRowKeys.value = []) && reload();
   }
  


</script>

<style scoped>

</style>